package com.ruoyi.wms.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.wms.mapper.WmsRepairSummaryMapper;
import com.ruoyi.wms.domain.WmsRepairSummary;
import com.ruoyi.wms.service.IWmsRepairSummaryService;
import com.ruoyi.common.core.text.Convert;

/**
 * 报修汇总Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-02-15
 */
@Service
public class WmsRepairSummaryServiceImpl implements IWmsRepairSummaryService 
{
    @Autowired
    private WmsRepairSummaryMapper wmsRepairSummaryMapper;

    /**
     * 查询报修汇总
     * 
     * @param id 报修汇总主键
     * @return 报修汇总
     */
    @Override
    public WmsRepairSummary selectWmsRepairSummaryById(Long id)
    {
        return wmsRepairSummaryMapper.selectWmsRepairSummaryById(id);
    }

    /**
     * 查询报修汇总列表
     * 
     * @param wmsRepairSummary 报修汇总
     * @return 报修汇总
     */
    @Override
    public List<WmsRepairSummary> selectWmsRepairSummaryList(WmsRepairSummary wmsRepairSummary)
    {
        return wmsRepairSummaryMapper.selectWmsRepairSummaryList(wmsRepairSummary);
    }

    /**
     * 新增报修汇总
     * 
     * @param wmsRepairSummary 报修汇总
     * @return 结果
     */
    @Override
    public int insertWmsRepairSummary(WmsRepairSummary wmsRepairSummary)
    {
        wmsRepairSummary.setCreateTime(DateUtils.getNowDate());
        return wmsRepairSummaryMapper.insertWmsRepairSummary(wmsRepairSummary);
    }

    /**
     * 修改报修汇总
     * 
     * @param wmsRepairSummary 报修汇总
     * @return 结果
     */
    @Override
    public int updateWmsRepairSummary(WmsRepairSummary wmsRepairSummary)
    {
        wmsRepairSummary.setUpdateTime(DateUtils.getNowDate());
        return wmsRepairSummaryMapper.updateWmsRepairSummary(wmsRepairSummary);
    }

    /**
     * 批量删除报修汇总
     * 
     * @param ids 需要删除的报修汇总主键
     * @return 结果
     */
    @Override
    public int deleteWmsRepairSummaryByIds(String ids)
    {
        return wmsRepairSummaryMapper.deleteWmsRepairSummaryByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除报修汇总信息
     * 
     * @param id 报修汇总主键
     * @return 结果
     */
    @Override
    public int deleteWmsRepairSummaryById(Long id)
    {
        return wmsRepairSummaryMapper.deleteWmsRepairSummaryById(id);
    }
}
